Reflog support#730
Conversation
lhchavez
left a comment
There was a problem hiding this comment.
sorry for the delay! for some reason i saw this, accidentally marked as read and completely forgot about it until today u_u
| return l | ||
| } | ||
|
|
||
| func (repo *Repository) ReadReflog(name string) (*Reflog, error) { |
There was a problem hiding this comment.
in order for these functions to be more easy to find in the docs, what do you think about modelling this similar to the other *Collection structs in https://godoc.org/github.com/libgit2/git2go#Repository? (i.e. there would be an Reflogs ReflogCollection). That way folks can do repo.Reflogs.Read("name") and repo.Reflogs.Delete("name").
also, i know we have not been super diligent about this, but could all public methods being introduced have a docstring? the godocs need a bit of love ^^;;
| } | ||
| } | ||
|
|
||
| func (l *Reflog) EntryByIndex(index uint) *ReflogEntry { |
There was a problem hiding this comment.
| func (l *Reflog) EntryByIndex(index uint) *ReflogEntry { | |
| func (l *Reflog) EntryByIndex(index uint64) *ReflogEntry { |
would it be possible to make this the widest size for any architecture that we support today? supporting more than 2^32 entries might be silly, but i'd rather be safe than sorry.
same in all the other places that use size_t in the C api.
| runtime.LockOSThread() | ||
| defer runtime.UnlockOSThread() | ||
|
|
||
| var rewriteHistoryInt int |
There was a problem hiding this comment.
| var rewriteHistoryInt int | |
| var rewriteHistoryInt C.int |
might as well define it as C.int from the get-go to avoid the cast in L144.
| cMsg := C.CString(message) | ||
| defer C.free(unsafe.Pointer(cMsg)) | ||
|
|
||
| C.git_reflog_append(l.ptr, oid.toC(), cSignature, cMsg) |
There was a problem hiding this comment.
can the error be handled?
Adds support and tests for all reflog functions listed on https://libgit2.org/libgit2/#HEAD/group/reflog.
Closes #467